/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package utt.edu.com.Controlador;

import javax.swing.JOptionPane;

/**
 *
 * @author julioelias
 */
public class ValidaDatos {
    
    public boolean ValidaEnteros(String dato) {
        boolean flag = false;
        try {
            if (Integer.parseInt(dato) >= 0) {
                flag = true;
            } else {
                flag = false;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "El dato " + dato + " no es entero");
        }
        return flag;
    }
    
    public boolean ValidaFloat(String dato) {
        boolean flag = false;
        try {
            if (Float.parseFloat(dato) >= 0.0) {
                flag = true;
            } else {
                flag = false;
            }
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "El dato " + dato + " no es float");
        }
        return flag;
    }
}
